package main

import (
	"encoding/json"
	"fmt"
)

type ArithResponse struct {
	Data int `json:"data"`
}

func doi(method string, reply interface{}) {
	s := reply //interface是引用类型，s变化，reply也跟着变
	var a = make(map[string]int)
	a["data"] = 2
	jsonStr, _ := json.Marshal(a)
	json.Unmarshal(jsonStr, s)
}

func main() {
	var res ArithResponse
	doi("Add", &res)
	fmt.Println(111, res.Data) //返回2，可以看到
}
